/**
 * <copyright>
 *
 * Copyright (c) 2011 Zeligsoft (2009) Limited
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: 
 *   Zeligsoft (2009) Limited - Initial API and implementation
 *
 * </copyright>
 *
 */
package org.omg.deployment.impl;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.omg.deployment.Any;
import org.omg.deployment.DeploymentPackage;
import org.omg.deployment.SatisfierProperty;
import org.omg.deployment.SatisfierPropertyKind;
import org.omg.xmi.impl.XMIImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Satisfier Property</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.omg.deployment.impl.SatisfierPropertyImpl#getName <em>Name</em>}</li>
 *   <li>{@link org.omg.deployment.impl.SatisfierPropertyImpl#getKind <em>Kind</em>}</li>
 *   <li>{@link org.omg.deployment.impl.SatisfierPropertyImpl#getDynamic <em>Dynamic</em>}</li>
 *   <li>{@link org.omg.deployment.impl.SatisfierPropertyImpl#getValue <em>Value</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SatisfierPropertyImpl extends XMIImpl implements SatisfierProperty {
	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The default value of the '{@link #getKind() <em>Kind</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getKind()
	 * @generated
	 * @ordered
	 */
	protected static final SatisfierPropertyKind KIND_EDEFAULT = SatisfierPropertyKind.QUANTITY;

	/**
	 * The default value of the '{@link #getDynamic() <em>Dynamic</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDynamic()
	 * @generated
	 * @ordered
	 */
	protected static final String DYNAMIC_EDEFAULT = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SatisfierPropertyImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DeploymentPackage.eINSTANCE.getSatisfierProperty();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return (String) getGroup().get(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Name(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Name(),
				newName);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SatisfierPropertyKind getKind() {
		return (SatisfierPropertyKind) getGroup().get(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Kind(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setKind(SatisfierPropertyKind newKind) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Kind(),
				newKind);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getDynamic() {
		return (String) getGroup().get(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Dynamic(),
				true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDynamic(String newDynamic) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Dynamic(),
				newDynamic);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Any getValue() {
		return (Any) getGroup().get(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Value(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetValue(Any newValue, NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup()).basicAdd(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Value(),
				newValue, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setValue(Any newValue) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getSatisfierProperty_Value(),
				newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd,
			int featureID, NotificationChain msgs) {
		switch (featureID) {
		case DeploymentPackage.SATISFIER_PROPERTY__VALUE:
			return basicSetValue(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case DeploymentPackage.SATISFIER_PROPERTY__NAME:
			return getName();
		case DeploymentPackage.SATISFIER_PROPERTY__KIND:
			return getKind();
		case DeploymentPackage.SATISFIER_PROPERTY__DYNAMIC:
			return getDynamic();
		case DeploymentPackage.SATISFIER_PROPERTY__VALUE:
			return getValue();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case DeploymentPackage.SATISFIER_PROPERTY__NAME:
			setName((String) newValue);
			return;
		case DeploymentPackage.SATISFIER_PROPERTY__KIND:
			setKind((SatisfierPropertyKind) newValue);
			return;
		case DeploymentPackage.SATISFIER_PROPERTY__DYNAMIC:
			setDynamic((String) newValue);
			return;
		case DeploymentPackage.SATISFIER_PROPERTY__VALUE:
			setValue((Any) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
		case DeploymentPackage.SATISFIER_PROPERTY__NAME:
			setName(NAME_EDEFAULT);
			return;
		case DeploymentPackage.SATISFIER_PROPERTY__KIND:
			setKind(KIND_EDEFAULT);
			return;
		case DeploymentPackage.SATISFIER_PROPERTY__DYNAMIC:
			setDynamic(DYNAMIC_EDEFAULT);
			return;
		case DeploymentPackage.SATISFIER_PROPERTY__VALUE:
			setValue((Any) null);
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case DeploymentPackage.SATISFIER_PROPERTY__NAME:
			return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT
					.equals(getName());
		case DeploymentPackage.SATISFIER_PROPERTY__KIND:
			return getKind() != KIND_EDEFAULT;
		case DeploymentPackage.SATISFIER_PROPERTY__DYNAMIC:
			return DYNAMIC_EDEFAULT == null ? getDynamic() != null
					: !DYNAMIC_EDEFAULT.equals(getDynamic());
		case DeploymentPackage.SATISFIER_PROPERTY__VALUE:
			return getValue() != null;
		}
		return super.eIsSet(featureID);
	}

} //SatisfierPropertyImpl
